package com.leyou.item.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

@TableName("tb_category") //表明实体类和哪个表对应
public class Category {
    @TableId(value = "id",type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    @TableField("name")
    private String name;
    @TableField("parent_id")
    private Long parentId; //如果是驼峰式命名，对应表字段为parent_id
    @TableField("is_parent")
    private Boolean isParent; // 注意isParent生成的getter和setter方法需要手动加上Is
    @TableField("sort")
    private Integer sort;
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public Long getParentId() {
        return parentId;
    }
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    public Boolean getIsParent() {
        return isParent;
    }
    public void setIsParent(Boolean parent) {
        isParent = parent;
    }
    public Integer getSort() {
        return sort;
    }
    public void setSort(Integer sort) {
        this.sort = sort;
    }
}
